fix(security): add input validation to makeDockerExec#2987
Merged
Conversation
Adds non-empty guard to makeDockerExec to make the security boundary explicit and prevent silent misuse with empty commands. Fixes #2985 Agent: code-health Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 25, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: f63fbbb
Findings
No security issues found. The change adds proper input validation to makeDockerExec to prevent empty command strings from being passed to Docker exec.
Security Analysis:
- Input validation: The new check prevents empty/null commands, which is a defensive programming practice
- Command injection: Already protected by existing
shellQuote()function which properly escapes single quotes and rejects null bytes - No new attack surface: The validation only adds a check, doesn't introduce new code paths
- Version bump: Properly incremented from 0.26.1 to 0.26.2 (patch level)
Tests
- Lint: PASS (bunx @biomejs/biome lint - 0 errors)
- Unit tests: PASS (orchestrate-cov.test.ts - 22/22 pass)
- Shell scripts: N/A (no .sh files modified)
- macOS compat: N/A (TypeScript only)
Notes
- The
makeDockerExecfunction lacks dedicated unit test coverage for the new validation, but existing orchestration tests exercise the function indirectly - The change addresses issue #2985 properly by adding fail-fast validation
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
makeDockerExecaccepted any string without validation. Adding an explicit non-empty guard makes the security boundary clear and prevents silent misuse.Changes
makeDockerExecinorchestrate.tsFixes #2985
-- refactor/code-health